package mySeHomework.homework2;

import cn.edu.ctgu.junitTest2.Configuration;

import java.io.IOException;
import java.nio.file.Files;
import java.nio.file.Path;
import java.util.Arrays;

public class ConfigurationData {
    public static Configuration createTempDataFile(String fileName) {
        Path path = ConfigurationTest.tempDir.resolve(fileName);
        try {
            Files.write(path, Arrays.asList(
                    "t1=true",
                    "t2=true",
                    "t3=true",
                    "t4=true",
                    "t5=true",
                    "t6=true",
                    "t7=true",
                    "t8=true",
                    "t9=true",
                    "t10=true",
                    "f1=false",
                    "f2=false",
                    "f3=false",
                    "f4=false",
                    "f5=false",
                    "f6=false",
                    "f7=false",
                    "f8=false",
                    "f9=false",
                    "f10=false",
                    "i1=1",
                    "i2=2",
                    "i3=3",
                    "i4=4",
                    "i5=5",
                    "d1=2021-01-01",
                    "d2=2021-02-28",
                    "d12=2021-12-31"
            ));
        } catch (IOException e) {
            e.printStackTrace();
        }
        Configuration configuration = new Configuration();
        configuration.fromFile(path.toFile());
        return configuration;
    }
}
